package tbs.framework.sql.converter.impl;

import tbs.framework.sql.converter.AbstractConvertor;

/**
 * 基础类型转换 CharSequence Number Boolean Character
 *
 * @author Abstergo
 */
public class BaseTypeConvertor extends AbstractConvertor {

    @Override
    public boolean support(Object obj) {
        Class<?> t = obj.getClass();
        return CharSequence.class.isAssignableFrom(t) ||
            Number.class.isAssignableFrom(t) ||
            Boolean.class.isAssignableFrom(t) ||
            CharSequence.class.isAssignableFrom(t);
    }

    @Override
    protected String doConvert(Object value) {
        return value.toString();
    }
}
